<template>
  <j-modal title="审计单位" :width="500" :visible="visible" :maskClosable="false" @close="close" destroyOnClose>
    <AuditTreeTable ref="AuditTreeTable" @selectedRow="handlerSelectedRow" />
  </j-modal>
</template>

<script>
import AuditTreeTable from '@/views/sj/sjmxgl/cwzb/components/AuditTreeTable'
export default {
  name: 'JSelectDepartModal',
  props: ['modalWidth', 'multi', 'rootOpened', 'departId'],
  components: { AuditTreeTable },
  data() {
    return {
      selectedRow: {},
      visible: false
    }
  },
  methods: {
    show() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.AuditTreeTable.show()
      })
    },
    close(status) {
      this.$emit('selectedRow', this.selectedRow)
      this.selectedRow = {}
      this.visible = false
    },
    handlerSelectedRow(selectedRow) {
      console.log('audit', selectedRow)
      this.selectedRow = selectedRow
    }
  }
}
</script>

<style lang="less" scoped>
.depart-Select {
  height: 500px;
  overflow: auto;
}
.table-active {
  background-color: #e6f7ff;
}
</style>
